home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 4.7 KB | 114 lines | [TEXT/MPS ] |
- //========================================================================================
- // File: FWViews.k
- // Release Version: $ ODF 1 $
- //
- // Constants shared between the framework code and view resources
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //========================================================================================
-
- #ifndef FWVIEWS_K
- #define FWVIEWS_K
-
- //----------------------------------------------------------------------------------------
- // Resource Types
- //----------------------------------------------------------------------------------------
-
- #ifdef FW_BUILD_MAC
- #define FW_kViewLayoutType 'FWvl'
- #define FW_kFontType 'FWft'
- #endif
-
- //----------------------------------------------------------------------------------------
- // View Bindings
- //----------------------------------------------------------------------------------------
- // These constants are used to define the layout maganement of subviews inside a superview
- // which is being resized.
- // - Each side of a FW_CView object can remain at a fixed distance to its parent view
- // with the left/right/top/bottom binding values set.
- // - You can also combine that with a fixed width or height (not all combinations are valid)
- //
- // By default a FW_CView object is created with a FW_kFixedBounds binding, which means that
- // it doesn't move when its parent view is resized.
- // Some subclasses of FW_CView override this with other default values:
- // - FW_CSuperView's default binding = FW_kFitToEnclosure.
- // - FW_CScrollBar's default binding = FW_kVScrollBarBinding or FW_kHScrollBarBinding
- // - FW_CGrowBox's default binding = FW_kGrowBoxBinding
- //
- // When declaring views in a .fr resource file you must enter the default value or any
- // other ones that make sense (leaving 0 means no binding at all and it won't yield good
- // results in general). Of course the binding value will be ignored if you provide your
- // own layout management code in MyView::AdjustToNewLayout().
-
- #define FW_kNoBinding 0x00000000
- #define FW_kLeftBinding 0x00000001
- #define FW_kRightBinding 0x00000002
- #define FW_kTopBinding 0x00000004
- #define FW_kBottomBinding 0x00000008
- #define FW_kFixedWidth 0x00000010
- #define FW_kFixedHeight 0x00000020
-
- #define FW_kFixedLocation (FW_kLeftBinding + FW_kTopBinding)
- #define FW_kFixedSize (FW_kFixedWidth + FW_kFixedHeight)
- #define FW_kFixedBounds (FW_kFixedLocation + FW_kFixedSize)
- #define FW_kFitToEnclosure (FW_kFixedLocation + FW_kRightBinding + FW_kBottomBinding)
-
- #define FW_kVScrollBarBinding (FW_kTopBinding+FW_kRightBinding+FW_kFixedWidth+FW_kBottomBinding)
- #define FW_kHScrollBarBinding (FW_kLeftBinding+FW_kBottomBinding+FW_kFixedHeight+FW_kRightBinding)
-
- #define FW_kGrowBoxBinding (FW_kBottomBinding+FW_kRightBinding+FW_kFixedSize)
-
- //----------------------------------------------------------------------------------------
- // View scrolling direction
- //----------------------------------------------------------------------------------------
-
- enum FW_EScrollingDirection
- {
- FW_kNoScrolling = 0x0000,
- FW_kXScrolling = 0x0001,
- FW_kYScrolling = 0x0010,
- FW_kXYScrolling = 0x0011
- };
-
- //----------------------------------------------------------------------------------------
- // Control receivers
- //----------------------------------------------------------------------------------------
- // Use the constants below to define which receiver handles the control's message.
- // (mainly used for push buttons)
- // Warning: if you want the control's view or the frame to be the receiver
- // you need to be sure that its class inherits from FW_MReceiver
-
- #define FW_kNoReceiver 0
- #define FW_kViewReceiver 1
- #define FW_kFrameReceiver 2
-
- // Scroll-bars are a special case, the scroller is always the default receiver
- #define FW_kScrollerReceiver 0
-
- //----------------------------------------------------------------------------------------
- // Button kinds
- //----------------------------------------------------------------------------------------
-
- #define FW_kPushButton 0
- #define FW_kRadioButton 1
- #define FW_kCheckButton 2
- #define FW_kDefaultPushButton 3
-
- #define FW_kMaxButtonKind FW_kDefaultPushButton
-
- //----------------------------------------------------------------------------------------
- // Reserved Object IDs for preregistering the root view
- //----------------------------------------------------------------------------------------
-
- #define FW_kPreregisteredRootViewObject -301
- #define FW_kPreregisteredFrameObject -303
-
- //----------------------------------------------------------------------------------------
- // Useful defines
- //----------------------------------------------------------------------------------------
-
- #define FW_MAXINT16 32767
- #define FW_MININT16 -32768
-
- #endif
-